﻿
<table class="bordered">
    <thead>
        <tr>
            <th>类别名称</th>
            <th>文章数量</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        @{
            var models = ViewBag.Cates as List<CategoryModel>;

            if (models != null && models.Count > 0)
            {
                for (int i = 0; i < models.Count; i++)
                {
                    var arcount = models[i].ArticleModels.Count;
                    <tr>
                        <td>
                            <input type="hidden" id="hid@(i)" value="@models[i].ID" />
                            <label id="lblcate@(i)"> @models[i].CategoryName</label>
                            <input class="inputbox2 inputFilter" style="display:none;" id="ipcate@(i)" type="text" value="@models[i].CategoryName" />
                            <a style="display:none;" id="savecate@(i)" href="javascript:;" onclick="saveCate(this,@i)">保存</a>
                            <a style="display:none;" id="cancelcate@(i)" href="javascript:;" onclick="cancelCate(@i)">取消</a>
                            <span class="red" id="spcate@(i)"></span>
                        </td>
                        <td><a id="lblACount@(i)" href="javascript:;" onclick="linkToArticle(@arcount,@(models[i].ID))">@(arcount)</a></td>
                        <td>
                            <a class="red" href="javascript:;" onclick="editCate(@i)"><i class="icon-edit"></i>编辑</a>&nbsp;
                            <a class="red" href="javascript:;" onclick="deleteCate(this,@i)"><i class="icon-remove"></i>删除</a>
                        </td>
                    </tr>
                }
            }
        }
    </tbody>
</table>
<script>
   
</script>